package com.alibaba.nacos.core.remote;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import lombok.extern.slf4j.Slf4j;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Getter
@Setter
@Slf4j
@Accessors(chain = true)
public class ConnectionMeta {
    String connectType;
    String clientIp;
    String remoteIp;
    int remotePort;
    int localPort;
    String version;
    String connectionId;
    Date createTime;
    long lastActiveTime;
    String appName;
    String tenant;
    long firstPushQueueBlockTime = 0;
    long lastPushQueueBlockTime = 0;
    protected Map<String, String> labels = new HashMap<>();
    boolean tlsProtected = false;

    public void clearPushQueueBlockTimes() {
        this.firstPushQueueBlockTime = this.lastPushQueueBlockTime = 0;
    }
}
